package com.mixmall.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mixmall.entity.MaiProductUser;
import com.mixmall.service.IMaiProductUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author caozhiren
 * @since 2024-09-26
 */
@Controller
@RequestMapping("/mixmall/maiProductUser")
public class MaiProductUserController {
    @Autowired
    IMaiProductUserService maiProductUserService;


//@PreAuthorize("hasRole('admin')")
@PreAuthorize("returnObject.userPhone.indexOf('*')!=-1")
@RequestMapping("/detail")
public Object getUserInfo(Map<String,Integer> userMap) {
    QueryWrapper<MaiProductUser> queryWrapper = new QueryWrapper<>();
    queryWrapper.lambda().eq(MaiProductUser::getId, userMap.get("pid"));
    MaiProductUser maiProductUser = maiProductUserService.getOne(queryWrapper);
    maiProductUser.setUserName("131****6255");
    return maiProductUser;
}
}

